package com.mdd.system.mapper;

import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.system.entity.SystemAuthAdmin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

/**
 * 系统管理员Mapper
 */
@Mapper
public interface SystemAuthAdminMapper extends IBaseMapper<SystemAuthAdmin> {

    /**
     * 获取角色管理员
     *
     * @author fzr
     * @param id 文件夹ID
     * @return List<Integer>
     */
    @Select("SELECT id FROM la_system_auth_admin WHERE is_delete=0 AND FIND_IN_SET(#{id}, role_ids)")
    List<Long> selectChildrenById(Long id);

    /**
     * 获取角色管理员
     *
     * @author fzr
     * @param username
     * @return List<Integer>
     */
    @Select(" SELECT * FROM la_system_auth_admin WHERE is_delete=0 AND  username=#{username}")
    SystemAuthAdmin selectByUsername(String username);

}
